package cn.wolfcode.shop.cloud.pay;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AlipayConfig {
    @Bean
    public AlipayClient alipayClient(AlipayProperties alipayProperties) {
        return new DefaultAlipayClient(alipayProperties.getGatewayUrl(), alipayProperties.getApp_id(),
                alipayProperties.getMerchant_private_key(), "json", alipayProperties.getCharset(),
                alipayProperties.getAlipay_public_key(), alipayProperties.getSign_type());
    }
}
